package com.cyan.note.dto.manager.order;

import lombok.Data;
import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.util.List;

/**
 * 订单详情DTO
 * 
 * @author ZhangzhenYu
 * @since 2025-01-15
 */
@Data
public class OrderDetailDTO {

    /**
     * 订单ID
     */
    private Long id;

    /**
     * 订单编号
     */
    private String orderNumber;

    /**
     * 订单类型
     */
    private String orderType;

    /**
     * 订单类型名称
     */
    private String orderTypeName;

    /**
     * 订单状态
     */
    private String status;

    /**
     * 订单状态名称
     */
    private String statusName;

    /**
     * 订单来源
     */
    private String orderSource;

    /**
     * 订单来源名称
     */
    private String orderSourceName;

    /**
     * 客户信息
     */
    private CustomerInfo customer;

    /**
     * 服务信息
     */
    private ServiceInfo service;

    /**
     * 金额信息
     */
    private AmountInfo amount;

    /**
     * 时间信息
     */
    private TimeInfo time;

    /**
     * 打手信息列表
     */
    private List<WorkerInfo> workers;

    /**
     * 订单日志
     */
    private List<OrderLogInfo> logs;

    /**
     * 备注
     */
    private String remark;

    /**
     * 创建时间
     */
    private LocalDateTime createdAt;

    /**
     * 更新时间
     */
    private LocalDateTime updatedAt;

    /**
     * 客户信息
     */
    @Data
    public static class CustomerInfo {
        private Long customerId;
        private String customerName;
        private String customerPhone;
        private String customerWechat;
        private String customerLevel;
        private String customerAddress;
    }

    /**
     * 服务信息
     */
    @Data
    public static class ServiceInfo {
        private Long serviceId;
        private String serviceName;
        private String serviceDescription;
        private Integer serviceDuration;
        private BigDecimal servicePrice;
    }

    /**
     * 金额信息
     */
    @Data
    public static class AmountInfo {
        private BigDecimal orderAmount;
        private BigDecimal actualAmount;
        private BigDecimal discountAmount;
        private BigDecimal totalCommission;
        private BigDecimal shopProfit;
        private String paymentStatus;
    }

    /**
     * 时间信息
     */
    @Data
    public static class TimeInfo {
        private LocalDateTime appointmentTime;
        private LocalDateTime startTime;
        private LocalDateTime endTime;
        private Integer actualDuration;
        private Integer plannedDuration;
    }

    /**
     * 打手信息
     */
    @Data
    public static class WorkerInfo {
        private Long workerId;
        private String workerName;
        private String workerPhone;
        private String workerLevel;
        private BigDecimal commissionAmount;
        private BigDecimal commissionRate;
        private String assignTime;
        private String status;
    }

    /**
     * 订单日志信息
     */
    @Data
    public static class OrderLogInfo {
        private String action;
        private String actionName;
        private String operatorName;
        private String description;
        private LocalDateTime operateTime;
    }
}